﻿@{
    Layout = "~/Views/_LayoutPage1.cshtml";
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>选择科室</title>

</head>

<body>
    <div style="height: 100%" id="root"><div data-reactroot=""><div class="menu-wrapper sections-page"><div class="search-container"><!-- react-empty: 12 --><div class="search-position"><div class="search-wrapper search-focus"><div class="search" style="background-color: rgb(255, 255, 255); flex: 1 1 0%;"><span class="search-icon icon-search"></span><div class="search-text">搜索医院、医生</div><form class="search-input search-input-no-border" action="javascript:;"><input type="search" placeholder="搜索科室，支持中文/拼音/首字母检索" class="search-input search-input-no-border" style="width: 100%;"></form></div></div></div></div><div style="height: 100%;"><div class="menu touch-overflow"><div class="menu-item menu-item-senior"><div class="list-ord"><a class="list-item menu-item-action" data-spm-id="100.1003.1000.1"><div class="list-content">其他</div></a><a class="list-item " data-spm-id="100.1003.1000.2"><div class="list-content">内科系统</div></a><a class="list-item " data-spm-id="100.1003.1000.3"><div class="list-content">外科系统</div></a><a class="list-item " data-spm-id="100.1003.1000.4"><div class="list-content">儿科</div></a><a class="list-item " data-spm-id="100.1003.1000.5"><div class="list-content">妇产科</div></a><a class="list-item " data-spm-id="100.1003.1000.6"><div class="list-content">眼科</div></a><a class="list-item " data-spm-id="100.1003.1000.7"><div class="list-content">口腔科</div></a><a class="list-item " data-spm-id="100.1003.1000.8"><div class="list-content">耳鼻喉科</div></a><a class="list-item " data-spm-id="100.1003.1000.9"><div class="list-content">针灸推拿科</div></a><a class="list-item " data-spm-id="100.1003.1000.10"><div class="list-content">皮肤科</div></a><a class="list-item " data-spm-id="100.1003.1000.11"><div class="list-content">心理科</div></a><a class="list-item " data-spm-id="100.1003.1000.12"><div class="list-content">中医科</div></a><a class="list-item " data-spm-id="100.1003.1000.13"><div class="list-content">名中医馆</div></a></div></div><div class="menu-item menu-item-junior"><div class="list-ord"><a class="list-item " data-spm-id="100.1003.1000.14"><div class="list-content">起搏器程控门诊</div></a></div></div></div></div></div></div></div>
    <script>

        $(function () {
            $.post("/Home/getksmc", function (data) {
                var html = $("#tabksdl").html();

                for (var i = 0; i < data.data.length; i++) {
                    if (i == 0) {
                        html += "<tr><td id=t_" + data.data[i].GHKS + " style='background-color:transparent;'><div class='ksdl_left'></div> <div class='ksdl_right'>" + data.data[i].KSDL + "</div></td></tr>";
                    } else {
                        html += "<tr><td id=t_" + data.data[i].GHKS + ">" + data.data[i].KSDL + "</td></tr>"
                    }
                }
                html += "<tr><td></td></tr>"
                html += "<tr><td></td></tr>"

                $("#tabksdl").html(html)

              
                showksmc("1");

                $("#tabksdl td").mousedown(function () {
                    var ksmc = $(this).html();

                    $(this).css("background-color", "transparent");
                    
                    $('#tabksdl td').not(this).css('background-color', '#E0DEDF')

                   
                    $(".ksdl_left").css({ "width": "0px", "height": "0px", "padding-left": "0rem" });
                    $(".ksdl_right").css({ "width": "100%", "margin-top": "0px", "color": "#000000" });
                    var html = "<div class='ksdl_left'></div> <div class='ksdl_right'>" + ksmc + "</div>";
                    $(this).html(html);

                    
                    showksmc($(this).attr('id').split('_')[1]);

                });

            },"json")
        })
        
        

        function showksmc(a) {
         
            $.post("/Home/getksmc", { "ksid": a }, function (data) {
                $("#tabksmc").html("");
                var html = $("#tabksmc").html();
                for (var i = 0; i < data.data.length; i++) {
                    html += "<tr><td id=k_" + data.data[i].KSDM +">" + data.data[i].KSMC + " </td></tr>"
                }

                $("#tabksmc").html(html);

                $("#tabksmc td").mousedown(function () {
                    window.location.href = "/Yygh/DoctInfo?ksdm=" + $(this).attr('id').split('_')[1];

                })

            },"json")
        }
    </script>
</body>
</html>
